<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
    <![endif]-->
    <title>通讯录</title>
</head>
<body>
<div class="contant">
<div class="row">
        <div class="top">首页>通讯录</div>
        <div class="content addapply">
        <form class="form-horizontal" method="post" action='{:U("Group/Book_edit")}' enctype="multipart/form-data" onsubmit="return form_validate()">
            <div class="box" style="width: 50%">
                <h1>新增<span>(标*为必填项)</span></h1>
                <div class="list-block">
                    <div class="form-group">
                        <label for="rate" class="col-sm-2 control-label">岗位<span class="red">*</span></label>
                        <div class="col-sm-10">
                          <input id="post" name="post" type="text" class="form-control" value="{$bookInfo.post}" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="rate" class="col-sm-2 control-label">姓名<span class="red">*</span></label>
                        <div class="col-sm-10">
                          <input id="name" name="name" type="text" class="form-control" value="{$bookInfo.name}" >
                        </div>
                    </div>
                    <div class="form-group">
                         <label for="rate" class="col-sm-2 control-label">联系电话<span class="red">*</span></label>
                         <div class="col-sm-10">
                          <input name="tel" type="text" class="form-control" id='tel' value="{$bookInfo.tel}" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="rate" class="col-sm-2 control-label">邮箱地址<span class="red">*</span></label>
                        <div class="col-sm-10">
                          <input id="email" name="email" type="text" class="form-control" value="{$bookInfo.email}" >
                        </div>
                    </div>
                   <div class="form-group">
                    <label for="rate" class="col-sm-2 control-label">所属部门</label>
                    <div class="col-sm-10">
                     <select name="group_id">
                        <volist name='group' id='group'>
                         <option value="{$group.id}">{$group.name}</option>
                        </volist>
                     </select>
                     </div>
                   </div>
                </div>
                <div class="list-block">
                    <input type="submit" class="button01" value="提交">
                    <input type="hidden" name='id' value="{$bookInfo.id}" />
                    <button type="button" class="button01 goHistory" data-url='{:U("Group/Address_Book")}'>返回</button>
                </div>
            </div>
        </form>
        </div>
    </div>
</div>
<script src="http://www.jq22.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
<script src="__PUBLIC__/Admin/js/distpicker.data.js"></script>
<script src="__PUBLIC__/Admin/js/distpicker.js"></script>
<script src="__PUBLIC__/Admin/js/main.js"></script>
<script src="__PUBLIC__/Admin/js/imgUp.js"></script>
<script type="text/javascript">
  $('.goHistory').click(function(){
    window.history.back(-1);
  });

  function form_validate(){
    var phone = $('#tel').val();
    var post  = $('#post').val();
    var name  = $('#name').val();
    var email = $('#email').val();
    if(!(/^1[34578]\d{9}$/.test(phone))){
      alert("手机号码有误,请重填");
      $('#tel').focus();
      return false;
    }else if(post == ''){
      alert("岗位为空,请重填");
      $('#post').focus();
      return false;

    }else if(name == ''){
      alert("姓名为空,请重填");
      $('#name').focus();
      return false;

    }else if(!(/^[a-zA-Z0-9_-]+@([a-zA-Z0-9]+\.)+(com|cn|net|org)$/.test(email))){
      alert("邮箱有误,请重填");
      $('#email').focus();
      return false;
    }

      return true;
  }
</script>
</body>
</html>